require('./requireMap')
const Koa = require('koa')
const app = new Koa()
const send = require('koa-send')
const tcb = require('@cloudbase/node-sdk')
const httpServer = require("http").createServer(app.callback())

const serverConfig = require('./serverConfig')


/***************腾讯云初始化*****************/
const cloud = tcb.init(serverConfig.tcb)
const db = cloud.database()
const command = db.command



/**********共享关键变量并引入子模块**********/
Object.assign(require(':share/webServer'), { app, tcb, cloud, db, command }) //共享变量
require(':webModules')


/*******************开启服务器**************/
httpServer.listen(serverConfig.nodeServer.port)
console.log('nodeServer started')

